﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Product.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Site.ViewModels.ProductDetailsModels>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%=Model.Product!=null? Html.Encode(Model.Product.Name):string.Empty %>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="MetaContent" runat="server">
    <meta name="page-topic" content='<%=Html.Encode(Model.Product.Name) %>' />
    <meta name="title" content="<%=Html.Encode(Model.Product.Name) %> - Chọn quà, mua quà, tặng quà online muaqua.vn" />
    <meta name="keywords" content="<%=Model.Product.MetaKeyword %>" />
    <meta name="description" content="<%=Model.Product.MetaDescription %>" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="product-view">
    <div class="product-shop">
        <div class="product-name">
            <h1 ><%=Html.Encode(Model.Product.Name) %></h1>
        </div>      
        <div class="clear"></div>  
        <div class="pinfo">
            <p><label>Tình trạng: Còn hàng</label></p>
            <%if (Model.Product.Quantity <= 3)
              { %>
            <p class="avai-only">
                <span>Chỉ còn <strong><%=Model.Product.Quantity %></strong> sản phẩm</span>
            </p>
            <%} %>
            <p>
                <label>Giá bán: </label><span class="t_red"><strong><%=string.Format("{0:0,0}",Model.Product.UnitPrice) %> ₫</strong></span>
            </p>
            <p>
                <form action="/shopping/create" method="post" name="siteForm" id="siteForm">
                    <label>Số lượng:</label>
                    <%=Html.Hidden("hdProductID",Model.Product.ID) %>
                    <input type="text" id="txtQuantity" name="txtQuantity" style="width:30px" />
                    <a href="#" onclick="document.siteForm.submit();" class="button-pay"><img src="/Images/btn_cart.png" /></a>
                </form>
            </p>
            <div class="clear"></div>   
            <div class="product-link">
                <ul>
                    <li><a href="/user/wishlist/create/<%=Model.Product.ID %>">Thêm vào wishlist</a></li>
                </ul>
            </div>
        </div>  
        <div class="clear"></div>        
        <div class="product-sub">Thông tin thêm</div>
        <div class="pro-dt">           
            <ul>
                
                <li>
                    <div class="it_l">Kích thước</div>
                    <div class="it_r"><%=Model.Product.Size %></div>
                    <div class="clear"></div>
                </li>                
                <li>
                    <div class="it_l">Xuất xứ</div>
                    <div class="it_r"><%=Model.Product.Country!=null? Model.Product.Country.CountryName: string.Empty %></div>
                    <div class="clear"></div>
                </li>
                <li>
                    <div class="it_l">Chất liệu</div>
                    <div class="it_r"><%=Model.Product.Material %></div>
                    <div class="clear"></div>
                </li>
            </ul>
        </div> 
         <div class="clear"></div>
        <% Html.RenderPartial("~/Views/Product/Share.ascx", Model.Product); %>       
    </div>
    <div class="product-img-box">
        <div class="img-map">
            <%var listImg = SDT.Lib.Common.Utils.GenThumbnailInFolder(Model.Product.ID, 320, 240, Model.ImagePath, Model.ImageUrl,Model.LogoPath);
              var listThumImg = SDT.Lib.Common.Utils.GenThumbnailInFolder(Model.Product.ID, 56, 56, Model.ImagePath, Model.ImageUrl); %>
            <%if (listThumImg.Length > 0 && listImg.Length > 0)
              { %>      
            <div id="photo" class="photo">
                
                <div class="showimg" id="showimg" style="text-align:center">
                    <%if (listImg.Length > 0)
                      { %>
                      <a href="<%=listImg[0] %>">
                        <img src="<%=listImg[0]%>" height="240" width="320" alt="<%=Html.Encode(Model.Product.Name) %>" />
                      </a>
                    <%} %>
                </div>
                <div class="listimg" id="listimg">                    
                  <ul>
                    <%for (int i = 0; i < listThumImg.Length; i++)
                      { %>
                      <li style="cursor: pointer;" onclick="showBigImg('<%=listImg[i] %>');">
                        <img width="56" height="56" class="bor_img" alt="<%=Html.Encode(Model.Product.Name) %>" src="<%=listThumImg[i] %>" />			
                      </li>
                    <%} %>
                  </ul>
                </div>
            </div>
            <%} %>             
            <script type="text/javascript">
                function showBigImg($image) {
                    $("#showimg a").attr("href", $image);
                    $("#showimg img").attr("src", $image);
                }                
            </script>
        </div>
    </div>
    <div class="clear"></div>
    <div class="product-sub">Mô tả sản phẩm</div>
    <pre style="margin: 0px 5px 0 5px;">
        <%=Model.Product.Description %>
    </pre>
    
    <div class="clear"></div>
    <div class="product-sub">Từ khóa liên quan tới sản phẩm</div>    
    <%var tags = Model.Product.ProductTagMaps.Select(e => e.Tag).ToList(); %>        
    <% Html.RenderPartial("~/Views/Product/TagInProduct.ascx", tags); %>
    <div class="clear"></div>
    <%if (Model.Product != null)
      { %>
    <% Html.RenderAction("LatestComments", new { id = Model.Product.ID, number = 20 }); %>
    <% Html.RenderAction("Comment", new { id = Model.Product.ID }); %>
    <%} %>
    <div class="clear"></div>
    <% Html.RenderAction("OtherItems", "Product", new { id = Model.Product.ID, number = 12, title = "Sản phẩm liên quan" }); %>
</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="PathContent" runat="server">
<% Html.RenderPartial("~/Views/Product/Path.ascx", Model.ProductSearch); %>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="RightContent" runat="server">
<% Html.RenderPartial("~/Views/Shared/Common/Hotline.ascx"); %>
<div class="clear"></div>
<% Html.RenderAction("GetCart", "Product", new { title = "Thanh toán", viewName = "Cart" }); %>
<%--<div class="clear"></div>
<% Html.RenderPartial("~/Views/Product/Compare.ascx"); %>--%>
<div class="clear"></div>
<div class="bg_choice"><h4>Lựa chọn mua sắm</h4></div>
<div class="pad">
  <% Html.RenderPartial("~/Views/Product/Category.ascx", Model.ProductSearch); %>
  <% Html.RenderPartial("~/Views/Product/Price.ascx", Model.ProductSearch); %>  
</div>
<% Html.RenderAction("Lasted", "Product", new { typeid = 0, catid = 0, holidayid = 0, number = 12, hotYN = 0, newYN = 0, saleYN = 1, promoYN = 0, order = "ID", orderDir = "desc", title = "Sản phẩm giảm giá", viewName = "Sale" }); %>
<% Html.RenderAction("GetTags", "Product", new { typeid = 0, catid = Model.Product.CatID, holidayid = 0, eventid = 0, number = 20, order = "ID", orderDir = "desc", title = "Top từ khóa", viewName = "Tag" }); %>   
</asp:Content>
